package com.haungg.controller.sys;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.haungg.po.TMenu;
import com.haungg.sys.IMenuService;

@Controller
public class MenuController {
    @Resource
    private IMenuService menuService;

    @RequestMapping(value="/ftl/sys/menu.do",method={RequestMethod.GET,RequestMethod.POST})
    public String index(TMenu tMenu, Model model) {
        tMenu.setParentSid(0);
        List<TMenu> list = menuService.query(tMenu);
        model.addAttribute("menuList", list);
        return "/sys/menu/index";
    }
    
    @RequestMapping(value="/ftl/sys/childMenu.do",method={RequestMethod.POST})
    public String childMenu(TMenu tMenu, Model model) {
    	List<TMenu> list = menuService.query(tMenu);
        model.addAttribute("menuList", list);
        return "/sys/menu/treeItem";
    }
    
    @RequestMapping(value="/ftl/sys/edit.do",method={RequestMethod.POST})
    public String edit(TMenu tMenu, Model model) {
    	
        return "/sys/menu/info";
    }

   
}
